package com.myspace.controller.post;

import com.myspace.service.space.post.DeletePostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class DeletePostController {
    @Autowired
    private DeletePostService deletePostService;

    @DeleteMapping("/myspace/deletepost/")
    public Map<String, String> deletepost(@RequestParam Map<String, String> data) {

        Integer postId = Integer.parseInt(data.get("post_id"));
        System.out.println(postId);
        return deletePostService.deletepost(postId);
    }
}
